const { ResultError } = require('./result')

const loginCheck = (req, res, next) => {
  if (req.session.username) {
    next()
  } else {
    res.json(new ResultError('未登录'))
  }
}


module.exports = {
  loginCheck
}
